package com.phison.fenestrapro.dashboard.util;

import java.io.Serializable;
import java.util.ArrayList;

/**
 * 
 * 
 * @author Niall O'Hara
 * 
 */
@SuppressWarnings("serial")
public class Notifier implements Serializable {

	public abstract class ValueChangeListener implements Serializable {
		public abstract void valueChange(Object propertyId);
	}

	ArrayList<ValueChangeListener> listeners = new ArrayList<ValueChangeListener>();

	public void fireValueChange(Object propertyId) {
		//System.out.println("\t" + propertyId.toString());
		for (ValueChangeListener listener : listeners)
			listener.valueChange(propertyId);
	}

	public void addListener(ValueChangeListener valueChangeListener) {
		listeners.add(valueChangeListener);
	}
}
